home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Mail / MailEnclosure / MESendModules / Source / MSMail / MSMail.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  658 b   |  38 lines

  1. #import "MSMail.h"
  2. #import "FileName.h"
  3. #import "support.h"
  4. #include <sys/file.h>
  5.  
  6. #define START_STR "#<begin uuencode>\n"
  7. #define END_STR "#<end uuencode>\n\n"
  8.  
  9. @implementation MSMail
  10.  
  11. - buildBody
  12. {
  13.    int x, cnt, startLen, endLen;
  14.    id aFile;
  15.  
  16.    [super buildBody];
  17.    
  18.    startLen = strlen(START_STR);
  19.    endLen = strlen(END_STR);
  20.  
  21.    for(x = 0, cnt = [attachments count]; x < cnt; x++)
  22.    {
  23.       fwrite(START_STR, 1, startLen, fp);
  24.       aFile = [attachments objectAt: x];
  25.       uuencode([aFile basename],[aFile stringValue], fp, 0666);
  26.       fwrite(END_STR, 1, endLen, fp);
  27.    }
  28.  
  29.    return self;
  30. }
  31.  
  32. +(BOOL)supportsAttachments
  33. {
  34.    return YES;
  35. }
  36.  
  37. @end
  38.